Skip to main content

In-place Skinning

Preskinning Pass

The default skinning process can be described using the following diagram:

The depicted pipeline has the following properties:

  • The deformation compute shader is executed only once per frame regardless of the number of actual render passes.
  • Skinning vertex shader uses already deformed data (made by deformation compute shader) as the current frame vertex position, normal, and tangent.
  • The memory storage required to hold frame deformation data can be significant and can be calculated using the following formula: Number of deformed frame vertices * size of the deformed vertex (36 bytes for single-precision data, and 18 for half-precision data).
  • Skinning performance is mostly limited by memory bandwidth.

Direct Skinning in Vertex Shader

Rukhanka Animation can be switched to the In-place skinning operation mode. This mode can be enabled in Rukhanka's Settings Dialog. In-place skinning process can be shown using the following diagram:

The in-place skinning pipeline has the following properties:

  • There is no one-frame deformation computation step.
  • Skinning deformation is performed directly in mesh vertex shaders. The deformation code is executed every time the mesh vertex shader is executed. This means that every mesh rendering pass will perform its own skinned mesh deformation computation (applying skin matrices to the mesh vertices). For renderer pipelines, that have many frame render passes (depth pre-pass, shadow map cascade passes, etc.), this can introduce significant algorithmic pressure on the vertex shader stage.
  • Memory bandwidth is not an issue for this approach.
  • Memory requirements are significantly lower because there is no intermediate deformed vertex data storage buffer.
tip

The performance of the skinning part of the deformation pipeline can depend on many factors (used renderer pipeline, number of render passes, etc). To pick the best skinning mode, it is advisable to do performance tests with your project.